using System;
using System.Collections.Generic;
using System.Text;

namespace Danser_Entity.Queries.Data
{
    /// <summary>
    /// Danser database table names, table fields names and view names
    /// </summary>
    public class DBConstants
    {
        #region Table names:

        /// <summary>
        /// Table name as it appears in the DB
        /// </summary>
        public const String USERS_TABLE = "Users";
        /// <summary>
        /// Table name as it appears in the DB
        /// </summary>
        public const String VALIDATION_TEMPLATES_TABLE = "ValidationTemplates";
        /// <summary>
        /// Table name as it appears in the DB
        /// </summary>
        public const String QUERIES_TABLE = "Queries";
        /// <summary>
        /// Table name as it appears in the DB
        /// </summary>
        public const String TEST_RESULTS_TABLE = "TestResults";
        /// <summary>
        /// Table name as it appears in the DB
        /// </summary>
        public const String TEST_PARAMS_TABLE = "TestParams";
        /// <summary>
        /// Table name as it appears in the DB
        /// </summary>
        public const String TEST_INFO_TABLE = "TestInfo";
        /// <summary>
        /// Table name as it appears in the DB
        /// </summary>
        public const String VALIDATION_FAILURES_TABLE = "ValidationFailures";
        
        #endregion

        #region Field names:

        //ValidationTemplates
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String VALIDATION_TEMPLATES_ID = "id";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String VALIDATION_TEMPLATES_NAME = "Name";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String VALIDATION_TEMPLATES_APPLIED_ON_DEFAULT = "AppliedOnDefault";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String VALIDATION_TEMPLATES_MAIL_LIST = "mailList";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String VALIDATION_TEMPLATES_EXPRESSION = "expression";

        //Users
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String USERS_ID = "UserID";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String USERS_PERMISSION = "PermissionLevel";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String USERS_NAME = "UserName";

        //Queries
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String QUERIES_ID = "queryID";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String QUERIES_NAME = "queryName";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String QUERIES_DESCRIPTION = "description";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String QUERIES_STRING = "queryString";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String QUERIES_USERID = "userID";

        //TestResults
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_RXMIN = "RXMin";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_RXMAX = "RXMax";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_RXAVG = "RXAvg";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_TXMIN = "TXMin";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_TXMAX = "TXMax";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_TXAVG = "TXAvg";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_RSSI1 = "RSSI1";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_RSSI2 = "RSSI2";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_RSSI3 = "RSSI3";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_TEST_INFO_INDEX = "TestInfoIndex";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_TEST_PARAMS_INDEX = "TestParamsIndex";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_RESULTS_ATTENUATION = "Attenuation";

        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_INDEX = "TestInfoIndex";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_OPERATOR = "Operator";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_DATE = "Date";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_TIME = "Time";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_TEST_NAME = "TestName";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_APTYPE = "APType";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_APIP = "APIP";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_APFWVER = "APFWVer";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_NICMAC = "NICMAC";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_NICTYPE = "NICType";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_PROJ_NAME = "ProjectName";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_OS = "OS";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_TIC = "TIC";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_SETUP_NAME = "SetupName";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_PLATFORM_MODEL = "PlatformModel";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_PLATFORM_NAME = "PlatformName";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_TRAFFIC_PROTOCOL = "TrafficProtocol";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_IS_CONFIRMED = "isConfirmed";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_INFO_IS_ANCHOR = "isAnchor";

        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_PARAMS_INDEX = "TestParamsIndex";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_PARAMS_CHANNEL = "Channel";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_PARAMS_CHANNEL_WIDTH = "ChannelWidth";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_PARAMS_BAND = "Band";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TEST_PARAMS_TEST_INFO_INDEX = "TestInfoIndex";

        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String VALIDATION_FAILURES_TEMPLATE_ID = "ValidationTemplateID";
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String VALIDATION_FAILURES_TEST_INFO_ID = "TestInfoID";

        #endregion

        #region Views:
        /// <summary>
        /// field name as it appears in the DB
        /// </summary>
        public static readonly String TESTS_VIEW_NAME = "TestsView";

        #endregion

        #region Type Definitions:

        /// <summary>
        /// Regular expression pattern to include all DB string typed fields
        /// </summary>
        public static readonly String STRING_TYPED_FIEDLS =

            //Test Info table string fields
            TEST_INFO_INDEX             + "|" +
            TEST_INFO_OPERATOR          + "|" +
            TEST_INFO_TEST_NAME         + "|" +
            TEST_INFO_APIP              + "|" +
            TEST_INFO_APFWVER           + "|" +
            TEST_INFO_NICMAC            + "|" +
            TEST_INFO_NICTYPE           + "|" +
            TEST_INFO_PROJ_NAME         + "|" +
            TEST_INFO_OS                + "|" +
            TEST_INFO_TIC               + "|" +
            TEST_INFO_SETUP_NAME        + "|" +
            TEST_INFO_PLATFORM_MODEL    + "|" +
            TEST_INFO_PLATFORM_NAME     + "|" +
            TEST_INFO_TRAFFIC_PROTOCOL  + "|" +

            //Test params table string fields
            TEST_PARAMS_CHANNEL         + "|" +
            TEST_PARAMS_CHANNEL_WIDTH   + "|" +
            TEST_PARAMS_BAND            + "|" +

            //Users table string fields
            USERS_ID                    + "|" +
            USERS_NAME                  + "|" +
            USERS_PERMISSION            + "|" +

            //validations table string fields
            VALIDATION_TEMPLATES_NAME;

        /// <summary>
        /// Regular expression pattern to include all DB boolean typed fields
        /// </summary>
        public static readonly String BOOLEAN_TYPED_FIELDS =
            
            TEST_INFO_IS_CONFIRMED      + "|" +
            TEST_INFO_IS_ANCHOR         + "|" +

            //validations table boolean fields
            VALIDATION_TEMPLATES_APPLIED_ON_DEFAULT;

        #endregion
    }
}
